---
displayed_sidebar: "Chinese"
---

# SHOW SQLBLACKLIST

## 功能

显示 SQL 黑名单中的 SQL 正则表达式。

有关 SQL 黑名单的更多信息，请参阅 [管理 SQL 黑名单](../../../administration/Blacklist.md)。

:::tip

该操作需要 SYSTEM 级 BLACKLIST 权限。请参考 [GRANT](../account-management/GRANT.md) 为用户赋权。

:::

## 语法

```SQL
SHOW SQLBLACKLIST
```

## 返回

| **返回**      | **说明**                              |
| ------------- | ------------------------------------- |
| Index         | 已加入黑名单的 SQL 正则表达式的序号。 |
| Forbidden SQL | 已加入黑名单的 SQL 正则表达式。       |

## 示例

```Plain
mysql> SHOW SQLBLACKLIST;
+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Index | Forbidden SQL                                                                                                                                                                                                                                                                                          |
+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 1     | select count\(\*\) from .+                                                                                                                                                                                                                                                                             |
| 2     | select id_int \* 4, id_tinyint, id_varchar from test_all_type_nullable except select id_int, id_tinyint, id_varchar from test_basic except select \(id_int \* 9 \- 8\) \/ 2, id_tinyint, id_varchar from test_all_type_nullable2 except select id_int, id_tinyint, id_varchar from test_basic_nullable |
| 3     | select id_int from test_all_type_select1 order by id_int limit [1-7], [5-7]                                                                                                                                                                                                                            |
| 4     | select count\(distinct .+\) from .+                                                                                                                                                                                                                                                                    |
+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
